home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 23.zip
/
BS1 part 23
/
Hisoft Basic v1.03 disk 2.adf
/
Video
/
Video.BAS
< prev
next >
Wrap
BASIC Source File
|
1988-12-03
|
6KB
|
271 lines
' HiSoft BASIC version:
' label Select has been changed to XSelect
' label Loop has been changed to XLoop
Setup:
Colors=4
d=15 : MaxColors=(2^Colors)-1
TextColor=1
SCREEN CLOSE 2
IF Colors>2 THEN SCREEN 2,640,200,Colors,2 : WINDOW 2,"Videotitle",,28,2
DIM Text$(d),Colormatrix(d,3),Move(d),Speed(d)
Filler$=STRING$(16,"-")
Colormatrix(1,1)=15
Colormatrix(1,2)=15
Colormatrix(1,3)=15
Begin:
PRINT "Videotitle-Program ";
PRINT "by Hannes R"CHR$(252)"gheimer"
PRINT
XSelect:
PRINT "Select:"
PRINT "1 Enter Text"
PRINT "2 Read Object"
PRINT "3 Move Object"
PRINT "4 Define Color"
PRINT "5 Show Title"
PRINT
Query:
LOCATE 10,1
PRINT "Enter number:";
INPUT a$
a$=LEFT$(a$,1)
IF a$<"1" OR a$>"5" THEN BEEP: GOTO Query
IF a$="1" THEN EnterText
IF a$="2" THEN ReadObject
IF a$="3" THEN DefineMoveObject
IF a$="4" THEN DefineColor
IF a$="5" THEN ShowTitle
PRINT
END
EnterText:
CLS:INPUT "How many lines of text (1-15)";NoofLines$
IF NoofLines$="" THEN CLS: GOTO Begin
NoofLines=VAL(NoofLines$)
IF NoofLines<1 OR NoofLines>15 THEN BEEP: GOTO EnterText
FOR x=1 TO NoofLines
LINE INPUT "Text:";Text$(x)
NEXT x : CLS : GOTO Begin
ReadObject:
CLS
PRINT "Enter the NAME of the object you want TO load."
INPUT Objname$
IF Objname$="" THEN CLS : GOTO Begin
OPEN Objname$ FOR INPUT AS 1
OBJECT.SHAPE 1,INPUT$(LOF(1),1)
CLOSE 1
ObjFlag=1 : CLS : GOTO Begin
DefineMoveObject:
CLS:IF ObjFlag=0 THEN BEEP ELSE Mover
PRINT "No object currently in memory!"
PRINT "Press any key."
Pause:
a$=INKEY$
IF a$="" THEN Pause
CLS: GOTO Begin
Mover:
PRINT "Move the object to it's starting point"
PRINT "using the cursor keys."
PRINT "When located press <RETURN>"
ox=100 : oy=100 : Destination=0
OBJECT.HIT 1,0,0
OBJECT.ON 1
OBJECT.STOP 1
XLoop:
a$=INKEY$
IF a$=CHR$(13) THEN DestDef
IF a$=CHR$(28) THEN oy=oy-2
IF a$=CHR$(31) THEN ox=ox-5
IF a$=CHR$(30) THEN ox=ox+5
IF a$=CHR$(29) THEN oy=oy+2
OBJECT.X 1,ox : OBJECT.Y 1,oy
GOTO XLoop
DestDef:
CLS
Move(Destination*2+1)=ox : Move(Destination*2+2)=oy
Destination=Destination+1 : Move(0)=Destination
IF Destination=7 THEN Enddef
PRINT "Move the object to location"Destination
PRINT "<RETURN> = Set another location"
PRINT "<ESC> = End"
Loop2:
a$=INKEY$
IF a$=CHR$(13) THEN DestDef
IF a$=CHR$(27) THEN Enddef
IF a$=CHR$(28) THEN oy=oy-2
IF a$=CHR$(31) THEN ox=ox-5
IF a$=CHR$(30) THEN ox=ox+5
IF a$=CHR$(29) THEN oy=oy+2
OBJECT.X 1,ox : OBJECT.Y 1,oy
GOTO Loop2
Enddef:
Move(0)=Destination
OBJECT.OFF 1
CLS : GOTO Begin
DefineColor:
CLS:PRINT "Color values:"
Colors:
FOR x=0 TO MaxColors
COLOR -(x=0),x
LOCATE 5,(x*4) + 1
PRINT x;CHR$(32);CHR$(32)
NEXT x
ColorChange:
LOCATE 7,1:COLOR TextColor,Background
PRINT "Enter the number of the color you want to change."
PRINT "(e = End)"; : BEEP
INPUT Answer$
IF UCASE$(Answer$)="E" THEN AssignColor
Answer$=LEFT$(Answer$,2)
ColorNumber=VAL(Answer$)
IF ColorNumber<0 OR ColorNumber>MaxColors THEN BEEP: GOTO ColorChange
RGBRegulator:
r=Colormatrix(ColorNumber,1)
g=Colormatrix(ColorNumber,2)
b=Colormatrix(ColorNumber,3)
LOCATE 10,1: PRINT "Red: <7>=- <8>=+ ";Filler$
LOCATE 10,20+r : PRINT CHR$(124);
LOCATE 11,1: PRINT "Green: <4>=- <5>=+ ";Filler$
LOCATE 11,20+g : PRINT CHR$(124);
LOCATE 12,1: PRINT "Blue: <1>=- <2>=+ ";Filler$
LOCATE 12,20+b : PRINT CHR$(124);
LOCATE 13,1: PRINT " <0>=Color o.k."
PALETTE ColorNumber,r/15,g/15,b/15
EnterKeys:
Key$=INKEY$
IF Key$="" THEN EnterKeys
IF Key$="7" THEN r=r-1
IF Key$="8" THEN r=r+1
IF Key$="4" THEN g=g-1
IF Key$="5" THEN g=g+1
IF Key$="1" THEN b=b-1
IF Key$="2" THEN b=b+1
IF Key$="0" THEN ColorChange
IF r<0 THEN r=0
IF r>15 THEN r=15
IF g<0 THEN g=0
IF g>15 THEN g=15
IF b<0 THEN b=0
IF b>15 THEN b=15
Colormatrix(ColorNumber,1)=r
Colormatrix(ColorNumber,2)=g
Colormatrix(ColorNumber,3)=b
GOTO RGBRegulator
AssignColor:
a=Background : a$="Background"
GOSUB EnterColor:Background=a
a=TextColor : a$="Text Color"
GOSUB EnterColor:TextColor=a
a=TextBackground : a$="Text Background"
GOSUB EnterColor:TextBackground=a
COLOR TextColor,Background
CLS : GOTO Begin
EnterColor:
LOCATE 14,1
PRINT a$": ";a
Loop3:
LOCATE 14,1
PRINT a$; : INPUT Answer$
Answer=VAL(Answer$)
IF Answer$="" THEN Answer=.5
IF Answer<0 OR Answer>MaxColors THEN BEEP : GOTO Loop3
IF Answer<>.5 THEN a=Answer
RETURN
ShowTitle:
CLS
PRINT "Press the <RETURN> key"
PRINT "to begin showing the title."
WaitforKey:
a$=INKEY$
IF a$=CHR$(13) THEN CLS : c=10 :GOTO Countdown
GOTO WaitforKey
Countdown:
LOCATE 10,28 : PRINT c
c=c-1:IF c<0 THEN StartDisplay
Tim=INT(TIMER)
Wait2:
IF INT(TIMER)=Tim THEN Wait2
GOTO Countdown
StartDisplay:
WIDTH 60
COLOR TextColor,Background : CLS
COLOR TextColor,TextBackground
FOR x=1 TO NoofLines
Text$=LEFT$(Text$(x),60)
h=INT((60-LEN(Text$))/2)+2
LOCATE x+17-NoofLines,h : PRINT Text$
NEXT x
COLOR TextColor,Background
IF Move(0)=0 THEN MoveText
OBJECT.X 1,Move(1)
OBJECT.Y 1,Move(2)
OBJECT.ON 1
FOR x=1 TO Move(0)-1
OBJECT.STOP 1
GOSUB VelocityCalc
OBJECT.X 1,Move(x*2-1)
OBJECT.Y 1,Move(x*2)
OBJECT.VX 1,Speed(x*2-1)
OBJECT.VY 1,Speed(x*2)
OBJECT.HIT 1,0,0
OBJECT.START 1
Tst=TIMER
Loop4:
px=ABS(Move(x*2+1)-OBJECT.X(1))
py=ABS(Move(x*2+2)-OBJECT.Y(1))
IF INT(TIMER-Tst)<18 AND (px>15 OR py>15) THEN Loop4
NEXT x
OBJECT.OFF 1
MoveText:
Tst=TIMER
IF Move(0)<>0 THEN Finish
Wait3:
IF TIMER-Tst<(2*NoofLines+2) THEN Wait3
Finish:
FOR x=1 TO 30
SCROLL (1,1)-(630,100),0,3
SCROLL (1,100)-(630,180),0,-3
NEXT x
COLOR TextColor,Background
CLS : GOTO Begin
VelocityCalc:
ox=OBJECT.X (1) : oy=OBJECT.Y (1)
Move(x*2-1)=ox : Move(x*2)=oy
zx=Move(x*2+1) : zy=Move(x*2+2)
FOR xx=1 TO 64 STEP .2
Speed(x*2-1)=CINT((zx-ox)/xx)
Speed(x*2)=CINT((zy-oy)/xx)
IF ABS(Speed(x*2-1))<40 AND ABS(Speed(x*2))<40 THEN xx=64
NEXT xx
RETURN